<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="${ctxStatic }/yanchengh/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="${ctxStatic }/yanchengh/css/yanchenghu.css" />
		<script src="${ctxStatic }/jquery/jquery-1.8.3.min.js"></script>
		
		<style>
			#weixin-tip {
				display: none;
				position: fixed;
				left: 0;
				top: 0;
				background: rgba(0, 0, 0, 0.8);
				filter: alpha(opacity=80);
				width: 100%;
				height: 100%;
				z-index: 100;
			}
			
			#weixin-tip p {
				text-align: center;
				margin-top: 10%;
				padding: 0 5%;
				position: relative;
			}
			
			#weixin-tip p img {
				max-width: 100%;
				height: auto;
			}
			
			#weixin-tip .close {
				color: #fff;
				padding: 5px;
				font: bold 20px/24px simsun;
				text-shadow: 0 1px 0 #ddd;
				position: absolute;
				top: 0;
				left: 5%;
			}
		</style>
		
		<script type="text/javascript">
		
		//微信遮罩
		var is_weixin = (function() {
				return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
			})();
			window.onload = function() {
				var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight; //兼容IOS，不需要的可以去掉
				var btn = document.getElementById('J_weixin');
				var tip = document.getElementById('weixin-tip');
				var close = document.getElementById('close');
				if(is_weixin) {
						tip.style.height = winHeight + 'px'; //兼容IOS弹窗整屏
						tip.style.display = 'block';
						return false;
				}
			}
		
			$(function(){
				$('#close').click(function(){
					$('#weixin-tip').hide();
				})
			})
		
		function getQueryString(userid) {   
            var reg = new RegExp("(^|&)" + userid + "=([^&]*)(&|$)", "i");  
            var l = decodeURI(window.location.search);  
            var r = l.substr(1).match(reg);  
            if (r != null) return unescape(r[2]);  
            return null;  
        } 
		
		$(document).ready(function(){ 
			var browser = {
         			versions: function () {
         			 var u = navigator.userAgent, app = navigator.appVersion;
         			 return {   //移动终端浏览器版本信息
        				   trident: u.indexOf('Trident') > -1, //IE内核
        				   presto: u.indexOf('Presto') > -1, //opera内核
        				   webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
        				   gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
        				   mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
        				   ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
        				   android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
        				   iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
        				   iPad: u.indexOf('iPad') > -1, //是否iPad
        				   webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
        			  };
         			}(),
         			language: (navigator.browserLanguage || navigator.language).toLowerCase()
        		}
			if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
              	var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
             	 if (browser.versions.ios&&getQueryString("fromapp")!=null&&getQueryString("fromapp") == "ios") {
                //是否在IOS浏览器打开
                	showShare("1元包车去东方盐湖城","特价景区门票，一价全含，快喊同学一起去嗨吧。","https://www.xiakeyueche.com/userfiles/one.png"); 
                	return;
          	    } 
             	 if(browser.versions.android&&getQueryString("fromapp")!=null&&getQueryString("fromapp") == "android"){
             		// window.android.showShare("1元包车去东方盐湖城","特价景区门票，一价全含，快喊同学一起去嗨吧。","https://www.xiakeyueche.com/userfiles/one.png");
             		return;
            	  } 
            	}
			
		}); 
		
	     function openclient() {
	    	  var ua = navigator.userAgent.toLowerCase();
              var t;
              var config = {
                  /*scheme:必须*/
                  scheme:'xiakeyueche://activity?type=web&url=https://www.xiakeyueche.com/onecar.jsp&title=一元包车',
                  download_url: "http://www.xiakeyueche.com/download.jsp",
                  timeout: 1500
              };
             var startTime = Date.now();
             var ifr = document.createElement('iframe');
             if(ua.indexOf('os') > 0){
                 window.location.href="xiakeyueche://activity?type=web&url=http://www.xiakeyueche.com/onecar.jsp&title=一元包车";
             }else{
            	 ifr.src = config.scheme;
            	 ifr.style.display = 'none';
                 document.body.appendChild(ifr);
             }
             var t = setTimeout(function() {
                 var endTime = Date.now();
                 if (!startTime || endTime - startTime < config.timeout + 200) {
                     window.location = config.download_url;
                 } else {
                     
                 }
             }, config.timeout);

             window.onblur = function() {
                 clearTimeout(t);
             }
         }
		
		$(function(){
			$(".ych_fillin").click(function(){
				if(getQueryString("fromapp")== null||getQueryString("fromapp").length==0){
					openclient();
				}
				if(getQueryString("userid")== null||getQueryString("userid").length==0){

					var browser = {
	             			versions: function () {
	             			 var u = navigator.userAgent, app = navigator.appVersion;
	             			 return {   //移动终端浏览器版本信息
	            				   trident: u.indexOf('Trident') > -1, //IE内核
	            				   presto: u.indexOf('Presto') > -1, //opera内核
	            				   webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
	            				   gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
	            				   mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
	            				   ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
	            				   android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
	            				   iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
	            				   iPad: u.indexOf('iPad') > -1, //是否iPad
	            				   webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
	            			  };
	             			}(),
	             			language: (navigator.browserLanguage || navigator.language).toLowerCase()
	            		}
					
	            	if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
	              	var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
	              
	             	 if (browser.versions.ios) {
	                //是否在IOS浏览器打开
	                	goLogin();
	                	return;
	          	    } 
	             	 if(browser.versions.android){
	             		window.android.toLogin();
	             		return;
	            	  }
	            	} else {
	            	  //否则就是PC浏览器打开
	            	  $('#download').click(function(){
	            	    	window.location.href="https://itunes.apple.com/us/app/%E9%9C%9E%E5%AE%A2%E7%BA%A6%E8%BD%A6/id1263380176?l=zh&ls=1&mt=8";
	            	    })
	            	}	
				}
				else{
					window.location.href="${ctxFront}/mobile/activityInfo?userid="+getQueryString("userid");
				}
	        } 
				)
				
			});
		</script>
	</head>
	
	<div id="weixin-tip">
		<p>
			<img src="${ctxStatic }/yanchengh/img/zhezhao.png" alt="微信打开" />
			<span id="close" title="关闭" class="close">×</span>
		</p>
	</div>
	<body>
		<div id="yanchenghu">
			  <div class="mui-content">
			  	 <div class="ych_img01">
			  	 	  <img src="${ctxStatic }/yanchengh/img/yanchenghu01.jpg" />
			  	 </div>
			  	 <div class="ych_active">
			  	 	 <div class="active_box">
			  	 	 	   <div class="active_tit">
			  	 	 	   	 <p>活动细则</p>
			  	 	 	   </div>
			  	 	 	   <div class="active_img">
			  	 	 	   	    <img src="${ctxStatic }/yanchengh/img/active01.png" />
			  	 	 	   </div>
			  	 	 </div>
			  	 </div>
			  	 <div class="ych_pay">
			  	 	 <img src="${ctxStatic }/yanchengh/img/pay01.png" />
			  	 </div>
			  	 <div class="ych_active2">
			  	 	 <img src="${ctxStatic }/yanchengh/img/active02.png" />
			  	 </div>
			  	 <div class="sing_up">
			  	 	 <a id= href="javascript:" class="ych_fillin"></a>
			  	 </div>
			  	 <div class="scenic_spot">
			  	 	 <img src="${ctxStatic }/yanchengh/img/scenicspot.png" />
			  	 </div>
			  	 <div class="ycy_jpg">
			  	 	 <img src="${ctxStatic }/yanchengh/img/yanchenghu02.jpg" />
			  	 </div>
			  	  <div class="sing_up" style="background: #fff;padding-bottom: 20px;">
			  	 	 <a href="javascript:" class="ych_fillin"></a>
			  	 </div>
			  </div>
			  	<div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>
		</div>
		
		<script src="${ctxStatic }/yanchengh/js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init();


		</script>
	</body>

</html>